package com.panasonic.cn.cmsc;

import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.sql.SQLException;
import com.fujitsu.fks.jaaf.core.*;

public class SQLMM9802{
	private Hashtable paramsString     = new Hashtable();
	private Hashtable paramsBigDecimal = new Hashtable();
	private Hashtable paramsFree       = new Hashtable();
	private String lastSql_ = null;

	private String getString(String name){
		if(name==null) return "";
		String returnStr = (String)paramsString.get(name);
		if(returnStr==null) return "";
		return "'"+FrameworkCommon.stringReplaceSQuote(returnStr)+"'";
	}

	private String getBigDecimal(String name){
		if(name==null) return "";
		BigDecimal returnStr = (BigDecimal)paramsBigDecimal.get(name);
		if(returnStr==null) return "";
		return returnStr.toString();
	}

	private String getFree(String name){
		if(name==null) return "";
		String returnStr = (String)paramsFree.get(name);
		if(returnStr==null) return "";
		return returnStr;
	}

	public String getLastSql(){
		return lastSql_;
	}

	public SelectResultRset getNameNow(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	DISTINCT ");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append("	AND ");
		sql.append("	APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND  ");
		sql.append("	APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"  ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset getNameFea(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	DISTINCT ");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT > "+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset getNameAll(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	DISTINCT ");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND (");
		sql.append("	(APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"  AND APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" )");
		sql.append("	OR ( APL_BDT > "+getString("SYS_DATE")+" ) ");
		sql.append("	OR ( ");
		sql.append("	( APL_EDT < "+getString("SYS_DATE")+" ) AND (FM_TYP <> "+getString("FM_TYP_SUB")+" )");
		sql.append("	)) ");
		sql.append("	AND TRPT_NM_CN IS NOT NULL ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset getNameDel(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	DISTINCT ");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_EDT < "+getString("SYS_DATE")+" ");
		sql.append("	AND FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+" ");
		sql.append("		");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectDeliverAddByCustomerNow(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	(PMIT_CLNT_CD "+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"  ");
		sql.append("	OR VDR_CD IN(SELECT M23.SHP_DSTN_CD FROM M23 WHERE M23.CLNT_CD"+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"))");
		sql.append("	AND ");
		sql.append("	APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND  ");
		sql.append("	APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectDeliverAddByCustomerFea(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	(PMIT_CLNT_CD "+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"  ");
		sql.append("	OR VDR_CD IN(SELECT M23.SHP_DSTN_CD FROM M23 WHERE M23.CLNT_CD"+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"))");
		sql.append("	AND ");
		sql.append("	APL_BDT > "+getString("SYS_DATE")+" ");
		sql.append("	AND  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectDeliverAddByCustomerAll(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	(PMIT_CLNT_CD "+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"  ");
		sql.append("	OR VDR_CD IN(SELECT M23.SHP_DSTN_CD FROM M23 WHERE M23.CLNT_CD"+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"))");
		sql.append("	AND  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND (");
		sql.append("	(APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"  AND APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" )");
		sql.append("	OR ( APL_BDT > "+getString("SYS_DATE")+" ) ");
		sql.append("	OR ( ");
		sql.append("	( APL_EDT < "+getString("SYS_DATE")+" ) AND (FM_TYP <> "+getString("FM_TYP_SUB")+")");
		sql.append("	)) ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectDeliverAddByCustomerDel(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	(PMIT_CLNT_CD "+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"  ");
		sql.append("	OR VDR_CD IN(SELECT M23.SHP_DSTN_CD FROM M23 WHERE M23.CLNT_CD"+((getString("PMIT_CLNT_CD").equals(""))?" is null ":"=")+getString("PMIT_CLNT_CD")+"))");
		sql.append("	AND  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_EDT < "+getString("SYS_DATE")+" ");
		sql.append("	AND FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByCORPCDNow(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	CORP_CD "+((getString("CORP_CD").equals(""))?" is null ":"=")+getString("CORP_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND  ");
		sql.append("	APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByCORPCDFea(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	CORP_CD "+((getString("CORP_CD").equals(""))?" is null ":"=")+getString("CORP_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT > "+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByCORPCDAll(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	CORP_CD "+((getString("CORP_CD").equals(""))?" is null ":"=")+getString("CORP_CD")+" ");
		sql.append("	AND  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND (");
		sql.append("	(APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"  AND APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" )");
		sql.append("	OR ( APL_BDT > "+getString("SYS_DATE")+" ) ");
		sql.append("	OR ( ");
		sql.append("	( APL_EDT < "+getString("SYS_DATE")+" ) AND (FM_TYP <> "+getString("FM_TYP_SUB")+")");
		sql.append("	)) ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" 	");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByCORPCDDel(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	CORP_CD "+((getString("CORP_CD").equals(""))?" is null ":"=")+getString("CORP_CD")+" ");
		sql.append("	AND  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_EDT < "+getString("SYS_DATE")+" ");
		sql.append("	AND FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+" ");
		sql.append("	ORDER BY ");
		sql.append("	VDR_CD,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByDevilerAddNow(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+"     ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND  ");
		sql.append("	APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	VDR_CD IN (");
		sql.append("	SELECT");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP_SUB").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP_SUB")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND  ");
		sql.append("	APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+") ");
		sql.append("	OR VDR_CD IN (");
		sql.append("  SELECT  M23.CLNT_CD FROM M23 WHERE M23.SHP_DSTN_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("     AND M23.CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append("     AND  M23.APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("     AND  M23.APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" ");
		sql.append("     AND M23.FM_TYP <> "+getString("FM_TYP")+"");
		sql.append("  )");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+"");
		sql.append("	");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByDevilerAddFea(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT > "+getString("SYS_DATE")+" ");
		sql.append("	AND ");
		sql.append("	VDR_CD IN (");
		sql.append("	SELECT ");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP_SUB").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP_SUB")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_BDT > "+getString("SYS_DATE")+" ");
		sql.append("	AND");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+"");
		sql.append("	) ");
		sql.append("  OR VDR_CD IN (");
		sql.append("  SELECT  M23.CLNT_CD FROM M23 WHERE M23.SHP_DSTN_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("     AND M23.CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append("     AND  M23.APL_BDT > "+getString("SYS_DATE")+" ");
		sql.append("     AND M23.FM_TYP <> "+getString("FM_TYP")+"");
		sql.append("  )");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByDevilerAddAll(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND (");
		sql.append("	(APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"  AND APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" )");
		sql.append("	OR ( APL_BDT > "+getString("SYS_DATE")+" ) ");
		sql.append("	OR ( ");
		sql.append("	( APL_EDT < "+getString("SYS_DATE")+" ) AND (FM_TYP <> "+getString("FM_TYP_SUB")+")");
		sql.append("	)) ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	AND ");
		sql.append("	VDR_CD IN (");
		sql.append("	SELECT ");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP_SUB").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP_SUB")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	FM_TYP <> "+getString("FM_TYP")+" ");
		sql.append("	AND (");
		sql.append("	(APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"  AND APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" )");
		sql.append("	OR ( APL_BDT > "+getString("SYS_DATE")+" ) ");
		sql.append("	OR ( ");
		sql.append("	( APL_EDT < "+getString("SYS_DATE")+" ) AND (FM_TYP <> "+getString("FM_TYP_SUB")+")");
		sql.append("	)) )");
		sql.append(" OR VDR_CD IN (");
		sql.append("  SELECT  M23.CLNT_CD FROM M23 WHERE M23.SHP_DSTN_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("     AND M23.CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append("     AND M23.FM_TYP <> "+getString("FM_TYP_SUB")+"");
		sql.append("     AND ((APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+" AND APL_EDT >"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+") OR");
		sql.append("       (APL_BDT >"+getString("SYS_DATE")+") OR");
		sql.append("       ((APL_EDT < "+getString("SYS_DATE")+") AND (FM_TYP <> "+getString("FM_TYP_SUB")+")))  ");
		sql.append("  )");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SelectCustomerByDevilerAddDel(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(VDR_CD,'') AS VDR_CD,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT,");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT,");
		sql.append("	NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append("	NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append("	NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append("	NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append("	NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append("	NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append("	NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID,");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE  ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+" ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_EDT < "+getString("SYS_DATE")+" ");
		sql.append("	AND FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append("	AND ");
		sql.append("	VDR_CD IN (");
		sql.append("	SELECT ");
		sql.append("	NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD ");
		sql.append("	FROM ");
		sql.append("	M01 ");
		sql.append("	WHERE ");
		sql.append("	VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("	AND ");
		sql.append("	TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP_SUB").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP_SUB")+"  ");
		sql.append("	AND ");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+" ");
		sql.append("	AND ");
		sql.append("	APL_EDT < "+getString("SYS_DATE")+" ");
		sql.append("	AND FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+" )");
		sql.append("	OR VDR_CD IN (");
		sql.append("  SELECT  M23.CLNT_CD FROM M23 WHERE M23.SHP_DSTN_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+" ");
		sql.append("     AND M23.CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append("     AND M23.APL_EDT < "+getString("SYS_DATE")+" ");
		sql.append("     AND FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append("  )");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}


	public void setVDR_CD(String value){
		if(value==null) {
			paramsString.remove("VDR_CD");
			return;
		}
		paramsString.put("VDR_CD",value);
	}


	public void setTRPT_CLSS_D_TYP(String value){
		if(value==null) {
			paramsString.remove("TRPT_CLSS_D_TYP");
			return;
		}
		paramsString.put("TRPT_CLSS_D_TYP",value);
	}


	public void setCTRL_DVSN_CD(String value){
		if(value==null) {
			paramsString.remove("CTRL_DVSN_CD");
			return;
		}
		paramsString.put("CTRL_DVSN_CD",value);
	}


	public void setSYS_DATE(String value){
		if(value==null) {
			paramsString.remove("SYS_DATE");
			return;
		}
		paramsString.put("SYS_DATE",value);
	}


	public void setFM_TYP(String value){
		if(value==null) {
			paramsString.remove("FM_TYP");
			return;
		}
		paramsString.put("FM_TYP",value);
	}


	public void setFM_TYP_SUB(String value){
		if(value==null) {
			paramsString.remove("FM_TYP_SUB");
			return;
		}
		paramsString.put("FM_TYP_SUB",value);
	}


	public void setPMIT_CLNT_CD(String value){
		if(value==null) {
			paramsString.remove("PMIT_CLNT_CD");
			return;
		}
		paramsString.put("PMIT_CLNT_CD",value);
	}


	public void setCORP_CD(String value){
		if(value==null) {
			paramsString.remove("CORP_CD");
			return;
		}
		paramsString.put("CORP_CD",value);
	}


	public void setTRPT_CLSS_D_TYP_SUB(String value){
		if(value==null) {
			paramsString.remove("TRPT_CLSS_D_TYP_SUB");
			return;
		}
		paramsString.put("TRPT_CLSS_D_TYP_SUB",value);
	}


}